package com.qitianyong.sgkusbcamera;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.qitianyong.selfclass.CustomApp;

import java.io.File;

public class MediaReceiver extends BroadcastReceiver {

    @Override

    public void onReceive(Context context, Intent intent) {

        switch (intent.getAction()) {
            case Intent.ACTION_MEDIA_CHECKING:
                break;
            case Intent.ACTION_MEDIA_MOUNTED:
                // 获取挂载路径, 读取U盘文件
//                Uri uri = intent.getData();
//                if (uri != null) {
//                    CustomApp.usbDiskPath = uri.getPath();
//                }
                break;

            case Intent.ACTION_MEDIA_EJECT:
                break;
            case Intent.ACTION_MEDIA_UNMOUNTED:
                break;

        }

    }

}